'use strict';

const RouterService = require('../base');

class BannerService extends RouterService {
  static get modelName() {
    return 'Business.Comment';
  }
  async create(data) {
    let { product_ids } = data;
    // 批量创建评论
    return await this.ctx.model.Business.Comment.bulkCreate(product_ids.map(item => {
      return {
        ...data,
        product_id: item,
        product_ids: undefined
      }
    }));
  }
}

module.exports = BannerService;
